package com.seednia.module.core.actionable.dto;

import java.util.Date;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import com.seednia.foundation.framework.dto.AbstractRecord;
import com.seednia.foundation.framework.dto.Constants;
import com.seednia.foundation.framework.dto.ICriteria;

@XmlRootElement(name = "ActionableCriteria", 
namespace = "http://seednia.com/core/1.0")
@XmlType(name = "ActionableCriteria")
@XmlAccessorType(XmlAccessType.PROPERTY)
public class ActionableCriteria extends ActionableDto implements ICriteria {

	/* Status greater or equal to */
	Integer statusGe = null;
	/* Status less or equal to. By default less than hidden */
	Integer statusLe = ActionableDto.STATUS_COMPLETED;

	/**
	 * 
	 */
	private static final long serialVersionUID = -9039914762889017906L;

	public ActionableCriteria(){
		this.setSid(Constants.SID_ANY);
		super.setStatus(Constants.INT_ANY);
		super.setPrivacyLevel(0);
		super.setSysStatus(Constants.SYS_STATUS_ACTIVE);
	}
	
	@Override
	public Date getCreatedBefore() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Date getCreatedAfter() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public void setSearchText(String value)
	{
		throw new UnsupportedOperationException();
	}
	
	
	
	public Integer getStatusGe() {
		return statusGe;
	}

	public void setStatusGe(Integer statusGe) {
		this.statusGe = statusGe;
	}

	public Integer getStatusLe() {
		return statusLe;
	}

	public void setStatusLe(Integer statusLe) {
		this.statusLe = statusLe;
	}

	/**
	 * To create object from JSONP string
	 * Used by the REST framework when sending this object as parameter
	 * @param jsonStr
	 * @return
	 */
	public static ActionableCriteria fromString(String jsonStr) {
		ActionableCriteria retval = (ActionableCriteria) AbstractRecord.fromString(ActionableCriteria.class, jsonStr);
		return retval;
	}
}
